package com.qf.service;

import com.qf.dao.Userdao;
import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.qf.service
 * @Description:
 * @Date 2022/6/30 20:10
 */
@Service
public class Userserviceimpl implements Userservice {
    @Autowired
    private Userdao userdao;
    @Override
    public List<User> findallService() {
        List<User> all = userdao.findAll();
        return all;
    }

    /**
     * 分页
     * @return
     */
    @Override
    public List<User> findpageUserall() {
        List<User> all = userdao.findAll();
        return all;
    }

    @Override
    public User findUserid(int id) {
        User userid = userdao.findUserid(id);
        return userid;
    }

    @Override
    public int addUSerService(User user) {
        int i = userdao.addUser(user);
        return i;
    }

    @Override
    public int updataUserservice(User user) {
        int updata = userdao.updata(user);
        return updata;
    }

    @Override
    public int deleteUserservice(int id) {
        int delete = userdao.delete(id);
        return delete;

    }


}
